const multer=require('multer');

const storage = multer.diskStorage({
    destination: function (req, file, cb) {  //你要存放在哪里
      cb(null, './src/uploads')
    },
    filename: function (req, file, cb) {  //文件名的写法
      
      let filename=file.originalname;
      let arr=filename.split('.');

      cb(null, Date.now()+'.'+arr[1])  //新建文本-asdsadasd.txt
    }
  })
  
  const upload = multer({ storage: storage })

  module.exports=upload;